* NOTE: change first line ("use") command based on your own directory

use "/Users/mtarsi/Desktop/UMAS0013_OUTPUT.dta"

set more off

svyset [pw=weight]

*Vote w leaners
recode q5 9=., gen(withleaners)
label values withleaners Q5
replace withleaners=1 if q5a==1
replace withleaners=2 if q5a==2

recode q1-q6a_7 q6b_1-q6b_7 q7_1-q14 (9=.)

*Did R vote in 2012 election?
svy: tab q1

*Has R ever voted in Boston?
svy: tab q2

* Did R vote in primary election in September 2013?
svy: tab q3

* For Rs that voted in primary, for whom did you vote?
svy: tab q3a

*Likely voters are q4==10, where q4 is a 10 to 1 scale of likelihood for voting in November

*If election was today, who would you vote for? ALL VOTERS
svy: tab q5

* IF election was today...LIKELY VOTERS
svy: tab q5 if q4==10

* Leaners: if election was held today, who would you vote for? ALL VOTERS W LEANERS
svy: tab withleaners

* Leaners: if election was today....LIKELY VOTERS W LEANERS
svy: tab withleaners if q4==10

* Campaign Contact Info: Walsh
gen walshcontact=1 if q6a_1==1
replace walshcontact=2 if q6a_2==1
replace walshcontact=3 if q6a_3==1
replace walshcontact=4 if q6a_4==1
replace walshcontact=5 if q6a_5==1

label define contact 1 "Phone" 2 "In-person" 3 "Online" 4 "Not contacted" 5 "DK/Don't Remember"
label values walshcontact contact

svy: tab walshcontact if q4==10


*Campaign Contact Info: Connolly
gen connollycontact=1 if q6b_1==1
replace connollycontact=2 if q6b_2==1
replace connollycontact=3 if q6b_3==1
replace connollycontact=4 if q6b_4==1
replace connollycontact=5 if q6b_5==1

label values connollycontact contact

svy: tab connollycontact if q4==10


* Issues and Trust -- Candidate Evaluations is q7
svy: tab q7_1 if q4==10
svy: tab q7_2 if q4==10
svy: tab q7_3 if q4==10
svy: tab q7_4 if q4==10
svy: tab q7_5 if q4==10

* Candidate Representation and Group Interests is q8
svy: tab q8_1 if q4==10
svy: tab q8_2 if q4==10
svy: tab q8_3 if q4==10
svy: tab q8_4 if q4==10
svy: tab q8_5 if q4==10
svy: tab q8_6 if q4==10
svy: tab q8_7 if q4==10
svy: tab q8_8 if q4==10
 
 * Better handling unions
 svy: tab q9
 *....among LIKELY
 svy: tab q9 if q4==10
 
 * Menino approval
 *ALL VOTERS
 svy: tab q10 
 *LIKELY
 svy: tab q10 if q4==10
 
 * If Menino was on the ballot...
 *ALL:
 svy: tab q11
 *Likely voters:
 svy: tab q11 if q4==10
 
 * MENINO LEGACY
 svy: tab q12
 *likely voters:
 svy: tab q12 if q4==10
 
 * CASINOS
 svy: tab q13
 * likely voters
 svy: tab q13 if q4==10
 
 * POLICE PAY
 svy: tab q14
 *Likely voters:
 svy: tab q14 if q4==10
